package com.aiti.lulian.controller;

import com.aiti.base.core.base.controller.WebController;
import com.aiti.base.core.utils.message.Message;
import com.aiti.lulian.dto.CardTemplateStyleDto;
import com.aiti.lulian.dto.CardUserCardForwardCoverOptionDto;
import com.aiti.lulian.entity.CardTemplateStyle;
import com.aiti.lulian.entity.CardUserCardForwardCoverOption;
import com.aiti.lulian.service.CardTemplateStyleService;
import com.aiti.lulian.service.CardUserCardForwardCoverOptionService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/cardForwardCover")
public class CardForwardCoverOptionController extends WebController {

    @Autowired
    private CardUserCardForwardCoverOptionService cardForwardCoverOptionService;

    @PostMapping("/savePre")
    public Message save(@RequestBody CardUserCardForwardCoverOption entity) {
        return cardForwardCoverOptionService.savePre(entity);
    }

    @PutMapping("updatePre")
    public Message update(@RequestBody CardUserCardForwardCoverOption entity) {
        return cardForwardCoverOptionService.updatePre(entity);
    }

    @DeleteMapping("/delete")
    public Message delete(@RequestParam String baseId) {
        return cardForwardCoverOptionService.delete(baseId);
    }




    @GetMapping("/page")
    public Message page(CardUserCardForwardCoverOptionDto dto) {
        Page page = this.startPage(dto);
        return cardForwardCoverOptionService.coverPage(page, dto);
    }


}